package cn.edu.scnu.springbootch6.controller;

import cn.edu.scnu.springbootch6.entity.Comment;
import cn.edu.scnu.springbootch6.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index")
public class CommentController {
    @Autowired
    private CommentService commentService;
    @RequestMapping("/get/{id}")
    public Comment get(@PathVariable("id")int comment_id){
        return commentService.findById(comment_id);
    }
}
